//
//  HNSNProductOrderModel.m
//  ZYManagementSystem
//
//  Created by 星道 on 17/6/14.
//  Copyright © 2017年 焕宁. All rights reserved.
//

#import "HNSNProductOrderModel.h"

@implementation HNSNProductOrderModel


+ (instancetype)HN_ObjectWithKeyValus:(NSDictionary *)Dict
{
    return [[self alloc] initWithDict:Dict];
}


- (instancetype)initWithDict:(NSDictionary *)Dict
{
    if (self = [super init]) {

        [self setValuesForKeysWithDictionary:Dict];
    }
    return self;
}


- (void)setValue:(id)value forKey:(NSString *)key{

    if ([key isEqualToString:@"buyer"]){
        self.B_username = value[@"username"];
        self.B_petName = value[@"petName"];
    } else if ([key isEqualToString:@"trainLesson"]) {
        self.T_name = [value[@"name"] isKindOfClass:[NSNull class]]?@"未知":value[@"name"];
        self.T_ID = value[@"id"];
    } else if ([key isEqualToString:@"selectionId"])
    {
        self.ID = value;
    } else if ([key isEqualToString:@"coursePackage"])
    {
        self.C_name = value[@"name"];
    }
    else
    {
        [super setValue:value forKey:key];
    }
}

- (void)setValue:(id)value forUndefinedKey:(NSString *)key{

}

@end
